var e = require("../../@babel/runtime/helpers/interopRequireDefault")(require("../../@babel/runtime/regenerator")), t = require("../../@babel/runtime/helpers/asyncToGenerator"), r = getApp(), a = require("../../http/userApi.js"), n = require("../../http/activityApi.js");

Page({
    data: {},
    onLoad: function(a) {
        var n = this;
        return t(e.default.mark(function t() {
            return e.default.wrap(function(e) {
                for (;;) switch (e.prev = e.next) {
                  case 0:
                    if (e.prev = 0, r.showLoading(), "superCoupon" != a.type) {
                        e.next = 7;
                        break;
                    }
                    return e.next = 5, n.loadSuperCouponRule();

                  case 5:
                    e.next = 9;
                    break;

                  case 7:
                    return e.next = 9, n.loadAppRule();

                  case 9:
                    e.next = 14;
                    break;

                  case 11:
                    e.prev = 11, e.t0 = e.catch(0), console.log(e.t0);

                  case 14:
                    return e.prev = 14, wx.hideLoading(), e.finish(14);

                  case 17:
                  case "end":
                    return e.stop();
                }
            }, t, null, [ [ 0, 11, 14, 17 ] ]);
        }))();
    },
    loadSuperCouponRule: function() {
        var r = this;
        return t(e.default.mark(function t() {
            var a;
            return e.default.wrap(function(e) {
                for (;;) switch (e.prev = e.next) {
                  case 0:
                    return r.setData({
                        title: "活动规则"
                    }), e.next = 3, n.superCouponHome();

                  case 3:
                    a = e.sent, r.setData({
                        nodes: a.data.activityRule
                    });

                  case 5:
                  case "end":
                    return e.stop();
                }
            }, t);
        }))();
    },
    loadAppRule: function() {
        var r = this;
        return t(e.default.mark(function t() {
            var n;
            return e.default.wrap(function(e) {
                for (;;) switch (e.prev = e.next) {
                  case 0:
                    return r.setData({
                        title: "1983抽盒机使用规则"
                    }), e.next = 3, a.appRule();

                  case 3:
                    n = e.sent, r.setData({
                        nodes: n.msg
                    });

                  case 5:
                  case "end":
                    return e.stop();
                }
            }, t);
        }))();
    }
});